agents.anac.y2010.Yushu
Class Utility

java.lang.Object
  extended by agents.anac.y2010.Yushu.Utility

public class Utility
extends java.lang.Object


Constructor Summary
Utility()
           
 
Method Summary
static Action chooseRandomBidAction(Agent agent)
          Wrapper for getRandomBid, for convenience.
static Bid getRandomBid(UtilitySpace utilityspace)
           
static double Paccept(double u, double t1)
          This function determines the accept probability for an offer.
static double sq(double x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utility

public Utility()
Method Detail

chooseRandomBidAction

public static Action chooseRandomBidAction(Agent agent)
Wrapper for getRandomBid, for convenience.

Returns:
new Action(Bid(..)), with bid utility > MINIMUM_BID_UTIL. If a problem occurs, it returns an Accept() action.

getRandomBid

public static Bid getRandomBid(UtilitySpace utilityspace)
                        throws java.lang.Exception
Returns:
a random bid with high enough utility value.
Throws:
java.lang.Exception - if we can't compute the utility (eg no evaluators have been set) or when other evaluators than a DiscreteEvaluator are present in the util space.

Paccept

public static double Paccept(double u,
                             double t1)
                      throws java.lang.Exception
This function determines the accept probability for an offer. At t=0 it will prefer high-utility offers. As t gets closer to 1, it will accept lower utility offers with increasing probability. it will never accept offers with utility 0.

Parameters:
u - is the utility
t - is the time as fraction of the total available time (t=0 at start, and t=1 at end time)
Returns:
the probability of an accept at time t
Throws:
java.lang.Exception - if you use wrong values for u or t.

sq

public static double sq(double x)